<%@page import="java.util.Locale"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="com.tubemostwanted.entity.CategoryFeed"%>
<%@page import="com.tubemostwanted.entity.Tube" %>
<%@page import="java.util.List" %>
<%	
	request.setCharacterEncoding("UTF-8");
	ResourceBundle resource = ResourceBundle.getBundle("config", new Locale("vi"));
	String url = resource.getString("site_link");
	String title = resource.getString("site_title");
	String site_name = resource.getString("site_name");
	String description = resource.getString("site_description");
	String site_keyword = resource.getString("site_keywords");
	String image = "/images/logo.png";
%>
<jsp:include page="/element/header.jsp">	
	<jsp:param name="url" value="<%= url %>"/>
	<jsp:param name="title" value="<%=title %>"/>	
	<jsp:param name="site_name" value="<%=site_name %>"/>
	<jsp:param name="images" value="<%=image %>"/>
	<jsp:param name="key" value="<%=site_keyword %>"/>
	<jsp:param name="description" value="<%=description %>"/>
</jsp:include>

 <div class="clear"></div> 
 
<section id="wrapper">		
 <div class="page_wrap">
<div class="page_container box_alignleft sidebox">
	  <div class="ei-wrapper">
	  <div id="ei-slider" class="ei-slider">
	     <ul class="ei-slider-large">
	   	<%	
	     	CategoryFeed cateFeed = (CategoryFeed)request.getAttribute("result1");
			if(cateFeed!=null&&cateFeed.getListTube().size()>0){	
			for(Tube tub: cateFeed.getListTube()){							
		%>						
			<li style="padding: 0; background: #000;">
	       	 	<a href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html" style="display: block; text-align: center; padding-top: 20px;"> 
	        		<img src="<%=tub.getThumbImageUrl().getValue() %>" alt="<%=tub.getTitle()%>" style="width: 480px !important; height: 360px !important; margin: 0 !important;" />
	       	  	</a>
	          	<div class="ei-title" style="margin-right: 20px">
	          		<h2 style="color: white !important"><%=tub.getTitle().getValue() %></h2>           
	           	</div>
	        </li>
		<%	
				}
			}
		%>
		</ul>
	
		<ul class="ei-slider-thumbs">
		 	<li class="ei-slider-element"><%=cateFeed.getTitle() %></li>
			<%	
				if(cateFeed!=null&&cateFeed.getListTube().size()>0){	
				for(Tube tub: cateFeed.getListTube()){		
			%>						
			<li>
				<a href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html"><%=tub.getTitle().getValue() %></a>
				<img src="<%=tub.getThumbImageUrl().getValue() %>" alt="<%=tub.getTitle().getValue() %>" />
			</li>
			<%	
					}
				}
			%>
	      </ul>
	  </div>
	  </div>
	    
<div class="clear" style="height:30px;"></div>
	
	<%
		//Config number of category show in home page in config.properties file.		
		int numberShow = Integer.parseInt(resource.getString("number_of_cate_show"));
		for(int numberOfCategoryShow=2; numberOfCategoryShow<=numberShow; numberOfCategoryShow++){
		cateFeed = (CategoryFeed)request.getAttribute("result" + numberOfCategoryShow);
		if(cateFeed!=null&&cateFeed.getListTube().size()>0){
	%>
			<h2 class="title-line alignright"><a style="color: black"  href="/charts/most-vieweds"><%=cateFeed.getTitle() %></a></h2>
			<div class="viboxes">
			<ul>
	<%
		int i = 1;
		for(Tube tub: cateFeed.getListTube()){
			if((i%3)!=0){
	%>
				<li style="margin-right:30px; margin-bottom:18px;">
	<%
			}else{
	%>
				<li style="margin-right:30px; margin-bottom:18px;"  class="last">
	<%
			}
	%>				
			      	<div class="content" style="width:200px;">
						  <div class="preview" style="height:125px;">
							  <div class="picture">
							  <div class="alpha"><a href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html" title="<%=tub.getTitle()%>">
							  	<img src="<%=tub.getThumbImageUrl().getValue() %>" alt="<%=tub.getTitle().getValue() %>" width="200" height="125"/></a></div>
							  	<div class="date">
							  		<a class="button red small icon clock" href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html" ><%=tub.getTotalTime().getValue() %></a>
							  		<a class="button red small icon refresh repeat" href="http://www.youtube.com/watch?v=<%=tub.getTubeId()%>">Repeat &nbsp;</a>
						  	 	 </div>
						  	  </div>
				  		  </div>
						 <div class="title">
						 	<a href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html" title="<%=tub.getTitle().getValue()%>"><%=tub.getSubTitle()%></a>
						 </div>
					</div>
				</li>
	<%
			i++;
			}
	%>
		</ul>
		</div>
	<%
			}
		}
	%>
<br /> 

</div>
<div class="page_sidebox box_alignfull">
	<div class="follow_us">
		<div class="follow_social">
           <div class="iconBox">	       	 	
          	 	<div class="twitter" title="Yeah, stalking is allowed!">
           	 		<a href="http://twitter.com/Marius_SEO" target="_blank"></a>
           	 	</div>	       	
           	 	<div class="follow-text"> 	 
			 		<span>Follow us</span>
		 		</div>
	 		</div>
			 <div class="iconBox">
			 	<div class="facebook" title="Be one of our happy fans">
			 		<a href="http://www.facebook.com/videosoft" target="_blank"></a>
			 	</div>		
			 	<div class="follow-text">		
				 	<span>Be a Fan</span>
				 </div>
			 </div>
		<div class="iconBox">
			<div class="feedburner" title="Get fresh videos on your e-mail!">
				<a href="http://videoinedit.com/rss.php" target="_blank"></a>
			</div>
		 	<div class="follow-text">
		 		 <span>Subscribe</span>
		 	</div>		
		 </div>
	</div>
</div>	
	<jsp:include page="/element/most_view.jsp"/>
	<jsp:include page="/element/advertising_right01.jsp"/>			
	<jsp:include page="/element/categories.jsp"/>
	<jsp:include page="/element/tags.jsp"/>		
</div>
</div>
</div>

<div class="clear"></div>
<jsp:include page="/element/advertising_right02.jsp"/>	
<jsp:include page="/element/footer.jsp"/>	